Skip to content

Alter direct calls to redis using intermediate redis settings #1801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 30, 2015

Conversation

agjohnson
Copy link
Contributor

Redis will be split up into calls to redis cache server and redis celery
server. Instead of calling the intermediate object in settings, use existing
configuration for these two databases.

This bumps the version number for redis_cache, as it's far behind, as well as
the version for redis.

Bumps up redis_cache version, gets access to redis client used by cache layer
@@ -223,7 +221,11 @@ def get_anchor(self, request, **kwargs):
self.throttle_check(request)

query = request.GET.get('q', '')
redis_data = redis_client.keys("*redirects:v4*%s*" % query)
try:
redis_client = cache.get_client(None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know get_client was a thing. It doesn't appear to be documented?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it should just be using django.core.cache.cache. Seems this code would be dependent on implementation of the redis backend and redis being used as a cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's exposed from redis_cache. If the cache backend isn't redis, this expects to catch the AttributeError that will be thrown

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense. Guess the code depends on redis as it is :)

ericholscher added a commit that referenced this pull request Oct 30, 2015
Alter direct calls to redis using intermediate redis settings
@ericholscher ericholscher merged commit bc96f5b into master Oct 30, 2015
@berkerpeksag berkerpeksag deleted the cache-direct branch August 23, 2016 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants